/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mesaayuda.mrysi.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Gio
 */
@Entity
@Table(name = "TICKET")
@NamedQueries({
    @NamedQuery(name = "Ticket.findAll", query = "SELECT t FROM Ticket t")})
public class Ticket implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IDTICKET")
    private Short idticket;
    @Column(name = "NUMFOLIO")
    private Integer numfolio;
    @Column(name = "DESCRIPCIONTICKET")
    private String descripcionticket;
    @Column(name = "STATUS")
    private String status;
    @Column(name = "CALIFICACION")
    private Short calificacion;
    @Column(name = "RESOLVIOPROBLEMA")
    private Short resolvioproblema;
    @Column(name = "FECHAREGISTRO")
    @Temporal(TemporalType.DATE)
    private Date fecharegistro;
    @JoinColumn(name = "IDUSUARIOATIENDE", referencedColumnName = "IDUSUARIO")
    @ManyToOne
    private Usuario idusuarioatiende;
    @JoinColumn(name = "IDUSUARIOSOLICITANTE", referencedColumnName = "IDUSUARIO")
    @ManyToOne
    private Usuario idusuariosolicitante;
    @JoinColumn(name = "IDTOPICOAYUDA", referencedColumnName = "IDTOPICOAYUDA")
    @ManyToOne
    private Topicoayuda idtopicoayuda;
    @JoinColumn(name = "IDDEPARTAMENTO", referencedColumnName = "IDDEPARTAMENTO")
    @ManyToOne
    private Departamento iddepartamento;
    @JoinColumn(name = "IDCAUSASCERRARTICKET", referencedColumnName = "IDCAUSASCERRARTICKET")
    @ManyToOne
    private Causascerrarticket idcausascerrarticket;

    public Ticket() {
    }

    public Ticket(Short idticket) {
        this.idticket = idticket;
    }

    public Short getIdticket() {
        return idticket;
    }

    public void setIdticket(Short idticket) {
        this.idticket = idticket;
    }

    public Integer getNumfolio() {
        return numfolio;
    }

    public void setNumfolio(Integer numfolio) {
        this.numfolio = numfolio;
    }

    public String getDescripcionticket() {
        return descripcionticket;
    }

    public void setDescripcionticket(String descripcionticket) {
        this.descripcionticket = descripcionticket;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Short getCalificacion() {
        return calificacion;
    }

    public void setCalificacion(Short calificacion) {
        this.calificacion = calificacion;
    }

    public Short getResolvioproblema() {
        return resolvioproblema;
    }

    public void setResolvioproblema(Short resolvioproblema) {
        this.resolvioproblema = resolvioproblema;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public Usuario getIdusuarioatiende() {
        return idusuarioatiende;
    }

    public void setIdusuarioatiende(Usuario idusuarioatiende) {
        this.idusuarioatiende = idusuarioatiende;
    }

    public Usuario getIdusuariosolicitante() {
        return idusuariosolicitante;
    }

    public void setIdusuariosolicitante(Usuario idusuariosolicitante) {
        this.idusuariosolicitante = idusuariosolicitante;
    }

    public Topicoayuda getIdtopicoayuda() {
        return idtopicoayuda;
    }

    public void setIdtopicoayuda(Topicoayuda idtopicoayuda) {
        this.idtopicoayuda = idtopicoayuda;
    }

    public Departamento getIddepartamento() {
        return iddepartamento;
    }

    public void setIddepartamento(Departamento iddepartamento) {
        this.iddepartamento = iddepartamento;
    }

    public Causascerrarticket getIdcausascerrarticket() {
        return idcausascerrarticket;
    }

    public void setIdcausascerrarticket(Causascerrarticket idcausascerrarticket) {
        this.idcausascerrarticket = idcausascerrarticket;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idticket != null ? idticket.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ticket)) {
            return false;
        }
        Ticket other = (Ticket) object;
        if ((this.idticket == null && other.idticket != null) || (this.idticket != null && !this.idticket.equals(other.idticket))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mesaayuda.mrysi.model.Ticket[ idticket=" + idticket + " ]";
    }
    
}
